package data.account.attendee.lodging;

import java.util.Scanner;

public class LodgingData
{
	private int floor;
	public int floor() { return floor; }
	public void setFloor(int floor) { this.floor = floor; }
	
	private int room;
	public int room() { return room; }
	public void setRoom(int room) { this.room = room; }
	
	private String startDate;
	public String startDate() { return startDate; }
	public void setStartDate(String startDate) { this.startDate = startDate; }
	
	private int duration;
	public int duration() { return duration; }
	public void setDuration(int duration) { this.duration = duration; }

	private String mealPlan;
	public String mealPlan() { return mealPlan; }
	public void setMeal(String mealPlan) { this.mealPlan = mealPlan; }
	
	private int cost;
	public int cost() { return cost; }
	public void setCost(int cost) { this.cost = cost; }
	
	public LodgingData(int floor, int room, String startDate, int duration, 
			String mealPlan, int cost)
	{
		this.floor = floor;
		this.room = room;
		this.startDate = startDate;
		this.duration = duration;
		this.mealPlan = mealPlan;
		this.cost = cost;
	}

	public LodgingData(String data)
	{
		Scanner dataScanner = new Scanner(data);
		dataScanner.useDelimiter("%");

		floor = Integer.parseInt(dataScanner.next());
		room = Integer.parseInt(dataScanner.next());
		startDate = dataScanner.next();
		duration = Integer.parseInt(dataScanner.next());
		mealPlan = dataScanner.next();
		cost = Integer.parseInt(dataScanner.next());
	}
	
	public String toData()
	{
		return 	floor + "%" +
				room + "%" +
				startDate + "%" +
				duration + "%" +
				mealPlan + "%" +
				cost;
	}
}